using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._DataManagement._Features
{
    /// <summary>
    /// <para>Repair Self Intersection</para>
    /// <para>Repairs self-intersecting line or polygon features. The portion between the feature and the intersection points are either deleted or split into a new feature.</para>
    /// <para>修复自相交的线或面要素。要素与交点之间的部分将被删除或分割为新要素。</para>
    /// </summary>    
    [DisplayName("Repair Self Intersection")]
    public class RepairSelfIntersection : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RepairSelfIntersection()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The polyline or polygon feature class from which this tool will repair self-intersections.</para>
        /// <para>此工具将从中修复自交点的折线或面要素类。</para>
        /// </param>
        /// <param name="_repair_type">
        /// <para>Repair Type</para>
        /// <para><xdoc>
        ///   <para>Indicates whether the tool will delete or split self-intersections.</para>
        ///   <bulletList>
        ///     <bullet_item>Delete—Self-intersections will be deleted. This is the default.</bullet_item><para/>
        ///     <bullet_item>Split—Self-intersections will be split at the intersection point and retained.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示工具是删除还是拆分自相交。</para>
        ///   <bulletList>
        ///     <bullet_item>删除—将删除自交点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>分割—自交点将在交点处分割并保留。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public RepairSelfIntersection(object _in_features, _repair_type_value _repair_type)
        {
            this._in_features = _in_features;
            this._repair_type = _repair_type;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Repair Self Intersection";

        public override string CallName => "topographic.RepairSelfIntersection";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_features, _repair_type.GetGPValue(), _max_length, _repair_at_end_point.GetGPValue(), _modified_in_features];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polyline or polygon feature class from which this tool will repair self-intersections.</para>
        /// <para>此工具将从中修复自交点的折线或面要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Repair Type</para>
        /// <para><xdoc>
        ///   <para>Indicates whether the tool will delete or split self-intersections.</para>
        ///   <bulletList>
        ///     <bullet_item>Delete—Self-intersections will be deleted. This is the default.</bullet_item><para/>
        ///     <bullet_item>Split—Self-intersections will be split at the intersection point and retained.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示工具是删除还是拆分自相交。</para>
        ///   <bulletList>
        ///     <bullet_item>删除—将删除自交点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>分割—自交点将在交点处分割并保留。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Repair Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _repair_type_value _repair_type { get; set; }

        public enum _repair_type_value
        {
            /// <summary>
            /// <para>Delete</para>
            /// <para>Delete—Self-intersections will be deleted. This is the default.</para>
            /// <para>删除—将删除自交点。这是默认设置。</para>
            /// </summary>
            [Description("Delete")]
            [GPEnumValue("DELETE")]
            _DELETE,

            /// <summary>
            /// <para>Split</para>
            /// <para>Split—Self-intersections will be split at the intersection point and retained.</para>
            /// <para>分割—自交点将在交点处分割并保留。</para>
            /// </summary>
            [Description("Split")]
            [GPEnumValue("SPLIT")]
            _SPLIT,

        }

        /// <summary>
        /// <para>Maximum Removal Length</para>
        /// <para>The maximum length of the segment between the points of self-intersection. Only segments shorter than the specified maximum length are deleted.</para>
        /// <para>自相交点之间的线段的最大长度。仅删除短于指定最大长度的段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Removal Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _max_length { get; set; } = null;


        /// <summary>
        /// <para>Remove Self Intersections at End Point</para>
        /// <para><xdoc>
        ///   <para>Indicates whether this tool will remove, or avoid removing, any self-intersections whose end point is snapped on itself.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Self-intersections will be removed.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Any feature that has an end point that snaps to itself will not be removed. An example is a cul-de-sac. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示此工具是移除还是避免移除其端点对齐自身的任何自相交。</para>
        ///   <bulletList>
        ///     <bullet_item>选中—将移除自交点。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会移除任何具有对齐自身端点的特征。一个例子是死胡同。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Remove Self Intersections at End Point")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _repair_at_end_point_value _repair_at_end_point { get; set; } = _repair_at_end_point_value._false;

        public enum _repair_at_end_point_value
        {
            /// <summary>
            /// <para>REPAIR_ENDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REPAIR_ENDS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>IGNORE_ENDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("IGNORE_ENDS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _modified_in_features { get; set; }


        public RepairSelfIntersection SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}